package com.itheima.user.feign;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.media.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("heima-leadnews-wemedia")
public interface WmUserFeign {
    /**
     * 保存用户数据到媒体表中
     * @param wmUser
     * @return
     */
    @PostMapping("/api/v1/user/save")
    public ResponseResult insert(@RequestBody WmUser wmUser);

    /**
     * 根据名称查询媒体数据
     * @param id
     * @return
     */
    @GetMapping("/api/v1/user/findByName/{id}")
    public ResponseResult<WmUser> findById(@PathVariable("id") Integer id);
}
